package state;

import main.Game;

import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;

import button.Button;
import button.StandardButton;
import constans.Flag;
import constans.ResourceManager;

public class TheEndState extends State{

	Button newGameButton;
	int points;
	
	public TheEndState(int p)
	{
		points = p;
		newGameButton = new StandardButton(140,203,100,50,Flag.damageButton,ResourceManager.getImage("back"),ResourceManager.getSound("click"));
		
	}
	


		

	public void render(GameContainer container, Graphics g) throws SlickException
	{	
		super.render(container, g);
		newGameButton.render(container, g);
		g.setColor(Color.white);
		g.drawString("points: " + points, 400, 300);

	}
	public void update(GameContainer container, int delta) throws SlickException
	{	
		Input input = container.getInput();
		newGameButton.hover(input);
		if(newGameButton.click(input))
			Game.setState(Flag.startState, 0);

	}
}
